import { sum } from './js/sum'
// import './css/style.css'
import './less/style.less'
import './scss/style.scss'
import './stylus/style.styl'
import './icon/iconfont'
import './css/iconfont.css'
import tpl from './tpl/render.tpl'

console.log(sum(1, 2, 3, 4, 2))

document.getElementById('btn').onclick = function () {
  // * 动态导入
  import(/* webpackChunkName: "math" */ './js/math')
    .then(({ count }) => {
      console.log(count(3, 1))
    })
    .catch(e => {
      console.log('fail', e)
    })
}

// * 测试 tpl loader
const tplEl = document.getElementById('tpl')

tplEl.innerHTML = tpl({
  name: 'yojim', age: 18, car: '拖拉机', phone: 'iphone'
})